﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using System.Collections;

using DQYT.HTDZ.IDAL;
using Best.Framework.DALFactory;
using DQYT.HTDZ.Model;


namespace DQYT.HTDZ.BLL
{
    public class BDRoleMenuBLL
    {
        private readonly IBDRoleMenu dal = DataAccess.CreateBDRoleMenu();

        #region  Method

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(decimal JSD_ID, decimal MNU_ID)
        {
            return dal.Exists(JSD_ID, MNU_ID);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(BDRoleMenuModel model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BDRoleMenuModel model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(decimal JSD_ID, decimal MNU_ID)
        {
            return dal.Delete(JSD_ID, MNU_ID);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BDRoleMenuModel GetModel(decimal JSD_ID, decimal MNU_ID)
        {
            return dal.GetModel(JSD_ID, MNU_ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }

        #endregion  Method

        #region 新添加
        /// <summary>
        /// 获得下一个最大值
        /// </summary>
        /// <returns></returns>
        public int GetNextID()
        {
            return dal.GetNextID();
        }

        /// <summary>
        /// 更新表数据
        /// </summary>
        /// <param name="dt">数据</param>
        /// <param name="JSE_ID">角色ID</param>
        /// <returns></returns>
        public bool Update(DataTable dt, string JSE_ID)
        {
            return dal.Update(dt, JSE_ID);
        }

        /// <summary>
        /// 删除多条数据
        /// </summary>
        public bool Delete(int JSE_ID)
        {
            return dal.Delete(JSE_ID);
        }
        /// <summary>
        /// 执行事务
        /// </summary>
        /// <param name="alSQL"></param>
        /// <returns></returns>
        public void ExecuteSqlTran(ArrayList alSQL)
        {
            dal.ExecuteSqlTran(alSQL);
        }
        #endregion
    }
}
